package demo;
//饿汉模式
class SingTon{
    //程序开启就创建实例
    private static SingTon instane = new SingTon();

    public static SingTon getInstance(){
        return instane;
    }
    //私立方法
    private SingTon(){

    }
}
public class Test9 {
    public static void main(String[] args) {
        SingTon singTon = SingTon.getInstance();

    }
}
